package Task1;

import java.util.InputMismatchException;
import java.util.Scanner;

public class AgeException {
    public AgeException() {
    }

    public static int age;

    public static int getAge() {
        return age;
    }

    public static Scanner sc = new Scanner(System.in);

    public static void reset() {
        AgeException.age = 0;
    }

    public static void setAge() throws InputMismatchException {
        System.out.println("请输入需要设置的年龄：");
        AgeException.age = sc.nextInt();
    }
}
